package Operation;

/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-04-13
 * Time: 15:47
 * To BE A Better Person-2020-3-2
 */

import Book.BookList;

import java.util.Scanner;

/**
 * 借阅图书
 */
public class BorrOp implements IOoperation{


    @Override
    public void work(BookList bookList) {
        System.out.println("请输入你想借阅的书籍>:");
        Scanner sc=new Scanner(System.in);
        String name=sc.nextLine();
        for (int i = 0; i < bookList.Used; i++) {
            if(name.equals(bookList.books[i].getName())){
                bookList.books[i].setBorrowed(false);
            }
        }
        System.out.println("==========借阅成功========");
    }
}
